<div id="upload_pic">
	<% form_for(:photo, :url => {:action=>'new'}, :html => { :multipart => true, :class => "form_pic" }) do |f| -%>
		
		<p>上传您的图片</p>
		<%= text_field_for f, :title, @photo, { :text=>"标题", :required => true } %>
		<% if @flag ==PRODUCT -%>
		<div class="required">
			<div class="form_text">
				<label for="photo[retype]" class="label">选择分类</label>
				<span class="required_mark">*</span>
			</div>
			<%= f.select(:retype_id, Retype.find(:all).collect {|t| [ t.name, t.id ] })%>
		</div>
		<% end %>
		<%= text_area_for f, :description, @photo, { :text=>"产品描述", :cols =>30, :rows => 5 } %>
		<div class="form_text"><label class="label" for="pic">上传图片</label><span class="required_mark">*</span></div>
		<%= f.file_field :pic%>
		<%= error_message_on @photo, :pic_file_name -%>
		<%= error_message_on @photo, :pic_size -%>
		<%= error_message_on @photo, :pic_content_type%>
		<div class="submit">
			<%= submit_tag '上传' -%>	
		</div>
	     
	<% end -%>
</div>